.class public final Lcom/burstly/lib/network/request/RequestManager;
.super Ljava/lang/Object;
.source "RequestManager.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;,
        Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;,
        Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;
    }
.end annotation


# static fields
.field private static final LOG:Lcom/burstly/lib/util/LoggerExt; = null

.field private static final TAG:Ljava/lang/String; = "RequestManager"

.field private static final VIEWS:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/burstly/lib/ui/BurstlyView;",
            ">;"
        }
    .end annotation
.end field

.field private static sConnectivityManager:Landroid/net/ConnectivityManager;

.field private static sNetworkStateReceiver:Landroid/content/BroadcastReceiver;

.field private static sTelephonyManager:Landroid/telephony/TelephonyManager;


# instance fields
.field private mCachedLoaded:Z

.field private final mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/burstly/lib/persistance/ResponseSaver",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 49
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/network/request/RequestManager;->LOG:Lcom/burstly/lib/util/LoggerExt;

    .line 130
    new-instance v0, Ljava/util/ArrayList;

    const/16 v1, 0xa

    invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(I)V

    sput-object v0, Lcom/burstly/lib/network/request/RequestManager;->VIEWS:Ljava/util/List;

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 2
    .parameter "context"
    .parameter "zoneId"

    .prologue
    .line 265
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 266
    new-instance v0, Lcom/burstly/lib/persistance/ResponseSaver;

    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1, p2}, Lcom/burstly/lib/persistance/ResponseSaver;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v0, p0, Lcom/burstly/lib/network/request/RequestManager;->mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;

    .line 267
    return-void
.end method

.method static synthetic access$000()Lcom/burstly/lib/util/LoggerExt;
    .locals 1

    .prologue
    .line 44
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->LOG:Lcom/burstly/lib/util/LoggerExt;

    return-object v0
.end method

.method static synthetic access$100()Ljava/util/List;
    .locals 1

    .prologue
    .line 44
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->VIEWS:Ljava/util/List;

    return-object v0
.end method

.method public static addToNetworkStateWatcher(Lcom/burstly/lib/ui/BurstlyView;)V
    .locals 1
    .parameter "view"

    .prologue
    .line 291
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->VIEWS:Ljava/util/List;

    invoke-interface {v0, p0}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_0

    .line 292
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->VIEWS:Ljava/util/List;

    invoke-interface {v0, p0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 294
    :cond_0
    return-void
.end method

.method private static execute(Lcom/burstly/lib/network/request/BurstlyRequestTask;Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;)Lcom/burstly/lib/network/request/AbortableAsyncTask;
    .locals 1
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/burstly/lib/network/request/BurstlyRequestTask",
            "<TT;>;",
            "Lcom/burstly/lib/network/request/RequestManager$RequestDataObject",
            "<TT;>;)",
            "Lcom/burstly/lib/network/request/AbortableAsyncTask",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 397
    .local p0, request:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    .local p1, requestDataTO:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;,"Lcom/burstly/lib/network/request/RequestManager$RequestDataObject<TT;>;"
    iget-object v0, p1, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-virtual {p0, v0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->setCallback(Lcom/burstly/lib/network/request/IRequestCallback;)V

    .line 398
    const/4 v0, 0x0

    new-array v0, v0, [Ljava/lang/Void;

    invoke-virtual {p0, v0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 399
    return-object p0
.end method

.method public static getConnectionInfo()Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    .locals 8

    .prologue
    const/4 v7, 0x1

    .line 499
    const/4 v2, 0x0

    .line 500
    .local v2, info:Landroid/net/NetworkInfo;
    new-instance v0, Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;

    const-string v4, ""

    const-string v5, "unknown"

    const/4 v6, 0x0

    invoke-direct {v0, v4, v5, v6}, Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;-><init>(Ljava/lang/String;Ljava/lang/String;I)V

    .line 501
    .local v0, cInfo:Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    sget-object v4, Lcom/burstly/lib/network/request/RequestManager;->sConnectivityManager:Landroid/net/ConnectivityManager;

    if-eqz v4, :cond_0

    .line 502
    sget-object v4, Lcom/burstly/lib/network/request/RequestManager;->sConnectivityManager:Landroid/net/ConnectivityManager;

    invoke-virtual {v4}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;

    move-result-object v2

    .line 503
    if-nez v2, :cond_1

    move-object v1, v0

    .line 515
    .end local v0           #cInfo:Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    .local v1, cInfo:Ljava/lang/Object;
    :goto_0
    return-object v1

    .end local v1           #cInfo:Ljava/lang/Object;
    .restart local v0       #cInfo:Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    :cond_0
    move-object v1, v0

    .line 507
    .restart local v1       #cInfo:Ljava/lang/Object;
    goto :goto_0

    .line 509
    .end local v1           #cInfo:Ljava/lang/Object;
    :cond_1
    invoke-virtual {v2}, Landroid/net/NetworkInfo;->getType()I

    move-result v3

    .line 510
    .local v3, netType:I
    if-ne v3, v7, :cond_3

    .line 511
    new-instance v0, Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;

    .end local v0           #cInfo:Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    invoke-virtual {v2}, Landroid/net/NetworkInfo;->getTypeName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2}, Landroid/net/NetworkInfo;->getSubtypeName()Ljava/lang/String;

    move-result-object v5

    const/4 v6, 0x2

    invoke-direct {v0, v4, v5, v6}, Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;-><init>(Ljava/lang/String;Ljava/lang/String;I)V

    .restart local v0       #cInfo:Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    :cond_2
    :goto_1
    move-object v1, v0

    .line 515
    .restart local v1       #cInfo:Ljava/lang/Object;
    goto :goto_0

    .line 512
    .end local v1           #cInfo:Ljava/lang/Object;
    :cond_3
    if-nez v3, :cond_2

    .line 513
    new-instance v0, Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;

    .end local v0           #cInfo:Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    invoke-virtual {v2}, Landroid/net/NetworkInfo;->getTypeName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2}, Landroid/net/NetworkInfo;->getSubtypeName()Ljava/lang/String;

    move-result-object v5

    invoke-direct {v0, v4, v5, v7}, Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;-><init>(Ljava/lang/String;Ljava/lang/String;I)V

    .restart local v0       #cInfo:Lcom/burstly/lib/network/request/RequestManager$ConnectionInfo;
    goto :goto_1
.end method

.method private static initCore(Landroid/content/Context;)V
    .locals 2
    .parameter "context"

    .prologue
    .line 451
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 452
    .local v0, applicationContext:Landroid/content/Context;
    sget-object v1, Lcom/burstly/lib/network/request/RequestManager;->sConnectivityManager:Landroid/net/ConnectivityManager;

    if-nez v1, :cond_0

    .line 453
    const-string v1, "connectivity"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/net/ConnectivityManager;

    sput-object v1, Lcom/burstly/lib/network/request/RequestManager;->sConnectivityManager:Landroid/net/ConnectivityManager;

    .line 456
    :cond_0
    sget-object v1, Lcom/burstly/lib/network/request/RequestManager;->sTelephonyManager:Landroid/telephony/TelephonyManager;

    if-nez v1, :cond_1

    .line 457
    const-string v1, "phone"

    invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Landroid/telephony/TelephonyManager;

    sput-object v1, Lcom/burstly/lib/network/request/RequestManager;->sTelephonyManager:Landroid/telephony/TelephonyManager;

    .line 459
    :cond_1
    return-void
.end method

.method public static declared-synchronized initRquestManager(Landroid/content/Context;)V
    .locals 4
    .parameter "context"

    .prologue
    .line 420
    const-class v3, Lcom/burstly/lib/network/request/RequestManager;

    monitor-enter v3

    :try_start_0
    invoke-static {p0}, Lcom/burstly/lib/network/request/RequestManager;->initCore(Landroid/content/Context;)V

    .line 421
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 423
    .local v0, applicationContext:Landroid/content/Context;
    sget-object v2, Lcom/burstly/lib/network/request/RequestManager;->sNetworkStateReceiver:Landroid/content/BroadcastReceiver;

    if-nez v2, :cond_0

    .line 424
    new-instance v2, Lcom/burstly/lib/network/request/RequestManager$1;

    invoke-direct {v2}, Lcom/burstly/lib/network/request/RequestManager$1;-><init>()V

    sput-object v2, Lcom/burstly/lib/network/request/RequestManager;->sNetworkStateReceiver:Landroid/content/BroadcastReceiver;

    .line 440
    new-instance v1, Landroid/content/IntentFilter;

    const-string v2, "android.net.conn.CONNECTIVITY_CHANGE"

    invoke-direct {v1, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V

    .line 441
    .local v1, filter:Landroid/content/IntentFilter;
    sget-object v2, Lcom/burstly/lib/network/request/RequestManager;->sNetworkStateReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v2, v1}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 443
    .end local v1           #filter:Landroid/content/IntentFilter;
    :cond_0
    monitor-exit v3

    return-void

    .line 420
    .end local v0           #applicationContext:Landroid/content/Context;
    :catchall_0
    move-exception v2

    monitor-exit v3

    throw v2
.end method

.method public static isOnline()Z
    .locals 3

    .prologue
    const/4 v1, 0x0

    .line 481
    const/4 v0, 0x0

    .line 482
    .local v0, info:Landroid/net/NetworkInfo;
    sget-object v2, Lcom/burstly/lib/network/request/RequestManager;->sConnectivityManager:Landroid/net/ConnectivityManager;

    if-eqz v2, :cond_0

    .line 483
    sget-object v2, Lcom/burstly/lib/network/request/RequestManager;->sConnectivityManager:Landroid/net/ConnectivityManager;

    invoke-virtual {v2}, Landroid/net/ConnectivityManager;->getActiveNetworkInfo()Landroid/net/NetworkInfo;

    move-result-object v0

    .line 484
    if-nez v0, :cond_1

    .line 490
    :cond_0
    :goto_0
    return v1

    :cond_1
    invoke-virtual {v0}, Landroid/net/NetworkInfo;->isConnectedOrConnecting()Z

    move-result v1

    goto :goto_0
.end method

.method public static makeAdRequest(Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;Z)Lcom/burstly/lib/network/request/AbortableAsyncTask;
    .locals 5
    .parameter
    .parameter "canBeCancelled"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/burstly/lib/network/request/RequestManager$RequestDataObject",
            "<TT;>;Z)",
            "Lcom/burstly/lib/network/request/AbortableAsyncTask",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 315
    .local p0, requestData:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;,"Lcom/burstly/lib/network/request/RequestManager$RequestDataObject<TT;>;"
    invoke-static {}, Lcom/burstly/lib/network/request/RequestManager;->isOnline()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 316
    new-instance v0, Lcom/burstly/lib/network/request/BurstlyRequestTask;

    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mObjectToPost:Lcom/burstly/lib/network/beans/cookie/ICookieRequest;

    iget-object v2, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mUri:Ljava/lang/String;

    iget-object v3, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mTargetClass:Ljava/lang/Class;

    iget-object v4, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mBurstlyViewId:Ljava/lang/String;

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/burstly/lib/network/request/BurstlyRequestTask;-><init>(Lcom/burstly/lib/network/beans/cookie/ICookieRequest;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)V

    .line 318
    .local v0, request:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    invoke-virtual {v0, p1}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->setCanBeAborted(Z)V

    .line 319
    invoke-static {v0, p0}, Lcom/burstly/lib/network/request/RequestManager;->execute(Lcom/burstly/lib/network/request/BurstlyRequestTask;Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;)Lcom/burstly/lib/network/request/AbortableAsyncTask;

    move-result-object v1

    .line 322
    .end local v0           #request:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    :goto_0
    return-object v1

    .line 321
    :cond_0
    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-static {v1}, Lcom/burstly/lib/network/request/RequestManager;->onNoConnection(Lcom/burstly/lib/network/request/IRequestCallback;)V

    .line 322
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static makeDownloadTrackRequest(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/burstly/lib/network/request/IRequestCallback;)Lcom/burstly/lib/network/request/AbortableAsyncTask;
    .locals 3
    .parameter "context"
    .parameter "deviceId"
    .parameter "burstlyViewId"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Lcom/burstly/lib/network/request/IRequestCallback",
            "<",
            "Ljava/lang/String;",
            ">;)",
            "Lcom/burstly/lib/network/request/AbortableAsyncTask",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .local p3, callback:Lcom/burstly/lib/network/request/IRequestCallback;,"Lcom/burstly/lib/network/request/IRequestCallback<Ljava/lang/String;>;"
    const/4 v2, 0x0

    .line 356
    invoke-static {p0}, Lcom/burstly/lib/network/request/RequestManager;->initCore(Landroid/content/Context;)V

    .line 357
    invoke-static {}, Lcom/burstly/lib/network/request/RequestManager;->isOnline()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 358
    new-instance v0, Lcom/burstly/lib/downloadtracker/TrackDownloadRequest;

    invoke-direct {v0, p2, p0, p1}, Lcom/burstly/lib/downloadtracker/TrackDownloadRequest;-><init>(Ljava/lang/String;Landroid/content/Context;Ljava/lang/String;)V

    .line 359
    .local v0, trackDownloadRequest:Lcom/burstly/lib/downloadtracker/TrackDownloadRequest;
    invoke-virtual {v0, p3}, Lcom/burstly/lib/downloadtracker/TrackDownloadRequest;->setCallback(Lcom/burstly/lib/network/request/IRequestCallback;)V

    .line 360
    invoke-virtual {v0, v2}, Lcom/burstly/lib/downloadtracker/TrackDownloadRequest;->setCanBeAborted(Z)V

    .line 361
    new-array v1, v2, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/burstly/lib/downloadtracker/TrackDownloadRequest;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    move-result-object v1

    check-cast v1, Lcom/burstly/lib/network/request/AbortableAsyncTask;

    .line 364
    .end local v0           #trackDownloadRequest:Lcom/burstly/lib/downloadtracker/TrackDownloadRequest;
    :goto_0
    return-object v1

    .line 363
    :cond_0
    invoke-static {p3}, Lcom/burstly/lib/network/request/RequestManager;->onNoConnection(Lcom/burstly/lib/network/request/IRequestCallback;)V

    .line 364
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static makeIpListRequest(Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;)Lcom/burstly/lib/network/request/AbortableAsyncTask;
    .locals 5
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "<T:",
            "Ljava/lang/Object;",
            ">(",
            "Lcom/burstly/lib/network/request/RequestManager$RequestDataObject",
            "<TT;>;)",
            "Lcom/burstly/lib/network/request/AbortableAsyncTask",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 333
    .local p0, requestData:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;,"Lcom/burstly/lib/network/request/RequestManager$RequestDataObject<TT;>;"
    invoke-static {}, Lcom/burstly/lib/network/request/RequestManager;->isOnline()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 334
    new-instance v0, Lcom/burstly/lib/network/request/DownloadServerListTask;

    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mObjectToPost:Lcom/burstly/lib/network/beans/cookie/ICookieRequest;

    iget-object v2, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mUri:Ljava/lang/String;

    iget-object v3, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mTargetClass:Ljava/lang/Class;

    iget-object v4, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mBurstlyViewId:Ljava/lang/String;

    invoke-direct {v0, v1, v2, v3, v4}, Lcom/burstly/lib/network/request/DownloadServerListTask;-><init>(Lcom/burstly/lib/network/beans/cookie/ICookieRequest;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)V

    .line 336
    .local v0, request:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mHostProvider:Lcom/burstly/lib/service/IHostProvider;

    if-eqz v1, :cond_0

    .line 337
    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mHostProvider:Lcom/burstly/lib/service/IHostProvider;

    invoke-virtual {v0, v1}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->setHostProvider(Lcom/burstly/lib/service/IHostProvider;)V

    .line 339
    :cond_0
    invoke-static {v0, p0}, Lcom/burstly/lib/network/request/RequestManager;->execute(Lcom/burstly/lib/network/request/BurstlyRequestTask;Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;)Lcom/burstly/lib/network/request/AbortableAsyncTask;

    move-result-object v1

    .line 342
    .end local v0           #request:Lcom/burstly/lib/network/request/BurstlyRequestTask;,"Lcom/burstly/lib/network/request/BurstlyRequestTask<TT;>;"
    :goto_0
    return-object v1

    .line 341
    :cond_1
    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;->mCallback:Lcom/burstly/lib/network/request/IRequestCallback;

    invoke-static {v1}, Lcom/burstly/lib/network/request/RequestManager;->onNoConnection(Lcom/burstly/lib/network/request/IRequestCallback;)V

    .line 342
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static makeTrackEventRequest(Ljava/lang/String;Ljava/lang/String;)Lcom/burstly/lib/network/request/AbortableAsyncTask;
    .locals 4
    .parameter "url"
    .parameter "burstlyViewId"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")",
            "Lcom/burstly/lib/network/request/AbortableAsyncTask",
            "<",
            "Ljava/lang/Void;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v3, 0x0

    const/4 v1, 0x0

    .line 375
    if-nez p0, :cond_0

    .line 384
    :goto_0
    return-object v1

    .line 378
    :cond_0
    invoke-static {}, Lcom/burstly/lib/network/request/RequestManager;->isOnline()Z

    move-result v2

    if-eqz v2, :cond_1

    .line 379
    new-instance v0, Lcom/burstly/lib/network/request/SingleHostRequest;

    invoke-direct {v0, p0, p1}, Lcom/burstly/lib/network/request/SingleHostRequest;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 380
    .local v0, request:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<Ljava/lang/Void;>;"
    invoke-virtual {v0, v3}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->setCanBeAborted(Z)V

    .line 381
    new-array v1, v3, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/burstly/lib/network/request/AbortableAsyncTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    move-result-object v1

    check-cast v1, Lcom/burstly/lib/network/request/AbortableAsyncTask;

    goto :goto_0

    .line 383
    .end local v0           #request:Lcom/burstly/lib/network/request/AbortableAsyncTask;,"Lcom/burstly/lib/network/request/AbortableAsyncTask<Ljava/lang/Void;>;"
    :cond_1
    invoke-static {v1}, Lcom/burstly/lib/network/request/RequestManager;->onNoConnection(Lcom/burstly/lib/network/request/IRequestCallback;)V

    goto :goto_0
.end method

.method private static onNoConnection(Lcom/burstly/lib/network/request/IRequestCallback;)V
    .locals 4
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/burstly/lib/network/request/IRequestCallback",
            "<*>;)V"
        }
    .end annotation

    .prologue
    .line 408
    .local p0, callback:Lcom/burstly/lib/network/request/IRequestCallback;,"Lcom/burstly/lib/network/request/IRequestCallback<*>;"
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v1, "RequestManager"

    const-string v2, "No network connection available. Can not call for ads."

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Object;

    invoke-virtual {v0, v1, v2, v3}, Lcom/burstly/lib/util/LoggerExt;->logWarning(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 409
    if-eqz p0, :cond_0

    .line 410
    invoke-interface {p0}, Lcom/burstly/lib/network/request/IRequestCallback;->onNoConnection()V

    .line 412
    :cond_0
    return-void
.end method

.method public static removeFromNetworkStateWatcher(Lcom/burstly/lib/ui/BurstlyView;)V
    .locals 1
    .parameter "view"

    .prologue
    .line 302
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->VIEWS:Ljava/util/List;

    invoke-interface {v0, p0}, Ljava/util/List;->remove(Ljava/lang/Object;)Z

    .line 303
    return-void
.end method

.method public static declared-synchronized shutdown(Landroid/content/Context;)V
    .locals 5
    .parameter "context"

    .prologue
    .line 467
    const-class v1, Lcom/burstly/lib/network/request/RequestManager;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->sNetworkStateReceiver:Landroid/content/BroadcastReceiver;

    if-eqz v0, :cond_0

    .line 468
    sget-object v0, Lcom/burstly/lib/network/request/RequestManager;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "RequestManager"

    const-string v3, "Unregistering network reciever..."

    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v0, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 469
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    sget-object v2, Lcom/burstly/lib/network/request/RequestManager;->sNetworkStateReceiver:Landroid/content/BroadcastReceiver;

    invoke-virtual {v0, v2}, Landroid/content/Context;->unregisterReceiver(Landroid/content/BroadcastReceiver;)V

    .line 471
    :cond_0
    const/4 v0, 0x0

    sput-object v0, Lcom/burstly/lib/network/request/RequestManager;->sNetworkStateReceiver:Landroid/content/BroadcastReceiver;

    .line 472
    const/4 v0, 0x0

    sput-object v0, Lcom/burstly/lib/network/request/RequestManager;->sConnectivityManager:Landroid/net/ConnectivityManager;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 473
    monitor-exit v1

    return-void

    .line 467
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method


# virtual methods
.method public getResponseSaver()Lcom/burstly/lib/persistance/ResponseSaver;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lcom/burstly/lib/persistance/ResponseSaver",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;"
        }
    .end annotation

    .prologue
    .line 608
    iget-object v0, p0, Lcom/burstly/lib/network/request/RequestManager;->mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;

    return-object v0
.end method

.method public makeAdRequest(Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;)Lcom/burstly/lib/network/request/IAbortableRequest;
    .locals 3
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/burstly/lib/network/request/RequestManager$RequestDataObject",
            "<",
            "Lcom/burstly/lib/network/beans/ResponseBean;",
            ">;)",
            "Lcom/burstly/lib/network/request/IAbortableRequest;"
        }
    .end annotation

    .prologue
    .local p1, requestData:Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;,"Lcom/burstly/lib/network/request/RequestManager$RequestDataObject<Lcom/burstly/lib/network/beans/ResponseBean;>;"
    const/4 v2, 0x1

    .line 276
    iget-boolean v1, p0, Lcom/burstly/lib/network/request/RequestManager;->mCachedLoaded:Z

    if-nez v1, :cond_0

    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager;->mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;

    invoke-virtual {v1}, Lcom/burstly/lib/persistance/ResponseSaver;->isAllowedToLoad()Z

    move-result v1

    if-eqz v1, :cond_0

    .line 277
    new-instance v0, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;

    iget-object v1, p0, Lcom/burstly/lib/network/request/RequestManager;->mResponseSaver:Lcom/burstly/lib/persistance/ResponseSaver;

    invoke-direct {v0, p1, v1, p0}, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;-><init>(Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;Lcom/burstly/lib/persistance/ResponseSaver;Lcom/burstly/lib/network/request/RequestManager;)V

    .line 278
    .local v0, loadResponseTask:Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;
    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Void;

    invoke-virtual {v0, v1}, Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 279
    iput-boolean v2, p0, Lcom/burstly/lib/network/request/RequestManager;->mCachedLoaded:Z

    .line 282
    .end local v0           #loadResponseTask:Lcom/burstly/lib/network/request/RequestManager$LoadResponseTask;
    :goto_0
    return-object v0

    :cond_0
    invoke-static {p1, v2}, Lcom/burstly/lib/network/request/RequestManager;->makeAdRequest(Lcom/burstly/lib/network/request/RequestManager$RequestDataObject;Z)Lcom/burstly/lib/network/request/AbortableAsyncTask;

    move-result-object v0

    goto :goto_0
.end method
